Skip to content

fix(workbench): report result schema evidence - #691

Merged
ScriptedAlchemy merged 5 commits into
mainfrom
fix/issue-688-schema-provenance
Sep 6, 2026
Merged

fix(workbench): report result schema evidence#691
ScriptedAlchemy merged 5 commits into
mainfrom
fix/issue-688-schema-provenance

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • carry compiler-observed resultSchema declaration state through the canonical dev manifest and Application tree
  • keep declaration, static projection, observed validation/transformation, and structured-result availability separate in Inspector → Schema
  • render neutral absent, unknown, unprojectable, failed, and unavailable states without inferring provenance from result presence

Tests

Run on fc21f4f3b06fc06b1167c9a1ff7969f50b974007, which contains current origin/main:

  • pnpm build && pnpm typecheck && pnpm lint && pnpm test:unit — passed
  • pnpm test:route-unit — passed (10 files, 89 tests)
  • pnpm exec rstest --config rstest.unit.config.ts packages/workbench/tests/route-workspace.test.ts — passed (31 tests)
  • pnpm exec rstest --config rstest.config.ts packages/workbench/tests/audiobook-curator.acceptance.e2e.test.ts — passed at 1440×900 (1 test)
  • pnpm docs:site:build — passed (locale parity clean, 0 broken links / 28,317 anchors)

The en/zh Workbench docs list the Schema tab but make no provenance or validation guarantee, so no prose edit is needed.

Deslop

Deslop: GPT-5.6 Sol, 1 edit (made non-success validation text neutral across failure and cancellation).

Self-review

Reviewer: Claude Fable 5.1 Thinking High

  • High — production result presence was still treated as successful resultSchema validation: fixed. A positive validation/transformation row now requires a successful unit-render invocation; successful MCP/CLI production surfaces remain explicitly unknown, and non-success outcomes remain not recorded. Added rendered regression coverage and corrected browser acceptance.
  • Low — RouteResultSchemaState missing from agent-bundle/api: fixed; exported it and updated the changeset summary.
  • Low — one additional static module scan: dismissed for this narrow fix. The existing compiler scanner is the canonical declaration evidence; consolidating independent config/input/contract scans is unrelated refactoring.
  • Low — thin wiring/unknown coverage: covered by compiler-to-manifest, strict manifest-client, rendered unknown/validation-failure, and full compiler/client/tree/browser acceptance tests. No race-only fixture was added.
  • Low — docs: no current en/zh prose overstates the guarantee; the public-export docs build passed.
  • Second pass: no high-severity findings; added the requested explicit failed unit-render validation test.
  • Final pass after merging current origin/main: no blocking, high, or medium findings.

Closes #688

@changeset-bot

changeset-bot Bot commented Sep 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fc21f4f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy marked this pull request as ready for review September 6, 2026 21:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T21:18:43.150182Z fc21f4f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ScriptedAlchemy
ScriptedAlchemy merged commit fa7430b into main Sep 6, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc21f4f3b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

RouteContract,
RouteContractOrigin,
RouteProvenance,
RouteResultSchemaState,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Document the public schema-evidence export

This exposes RouteResultSchemaState through the public API and adds resultSchemaState to public route manifests, but the commit does not update either documentation locale. The handwritten architecture pages still enumerate the fields carried by CompiledAgentRoute without this field, so update the matching English and Chinese pages alongside the export.

AGENTS.md reference: AGENTS.md:L132-L138

Useful? React with 👍 / 👎.

Comment on lines +149 to +150
: invocation.outcome?.kind !== 'success'
? 'Not recorded · the invocation completed without a successful outcome.'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve validation evidence for non-success outcomes

For a successful unit-render whose application outcome is non-success, this branch incorrectly reports that schema parsing was not recorded. renderRouteEvents parses resultSchema before invocationOutcome classifies the result, so a CLI using a result-derived nonzero exit code—or an accepted represented-error document—can have a successfully parsed invocation.result while landing here. Outcome meaning should not override the positive validation evidence already established by a completed unit render with a result.

Useful? React with 👍 / 👎.

? 'Unavailable · this invocation recorded no structured result.'
: 'Available · open Structured result.',
);
const state = leaf.resultSchemaState ?? 'unknown';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bind schema evidence to the invocation revision

When inspecting a historical or deep-linked invocation after the route has been rebuilt, this reads declaration evidence from the current ApplicationLeaf even though the invocation carries its own manifestDigest and sourceRevision. Adding or removing resultSchema can therefore make an old parsed result appear to have no declaration, or make a pre-schema invocation appear declared. Persist the declaration state with the invocation or guard this combination by matching revisions.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workbench inspector must not infer resultSchema declaration or validation from result presence

1 participant